#!/usr/bin/python
import os,sys

class XXPInfo:
	def __init__(self):
		pass

	def help(self):
		cmd = sys.argv[0]
		print 'Please use the following cmd:'
		print '    ' + cmd + ' pid'
		print 'e.g.'
		print '    ' + cmd + ' 123' 

	def getInfo(self, pid):
		path = '/proc/' + pid + '/status'
		f = open(path, 'rb')
		lines = f.readlines()
		f.close()
		
		s = ""
		for line in lines:
			line = line.replace('\t', '')
			line = line.replace('\n', '')
			arr = line.split(':')
			#if arr[0] == "VmRSS":
			#	s += arr[1].strip().split(' ')[0]
			print arr[0] + '=' + arr[1].strip()
		#print s

t = XXPInfo()
if len(sys.argv) != 2:
	t.help()
else:
	t.getInfo(sys.argv[1])

